<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绑定失败</title>
    <style>
        .bind-img-box {
            display: flex;
            justify-content: center;
        }

        .bind-img {
            width: 19.75rem;
            padding: 2.5rem;
        }

        .text {
            line-height: 3.12rem;
            text-align: center;
            font-size: 1.4rem;
        }

        .btn {
            width: 18.75rem;
            height: 3.12rem;
            line-height: 3.12rem;
            text-align: center;
            color: #fff;
            background: url("./img/button-bg.png") no-repeat 100% 100%;
            font-size: 1.2rem;
            margin: 3.5rem auto;
        }

        .btn-box {
            display: flex;
            justify-content: center;
        }

        .remove {
            display: none;
        }

        .back-btn {
            background-color: #0d0d10;
            border: none;
            outline-color: none;
            border-radius: 6px;
            height: 2.5rem;
            padding: 0 1rem;
            color: #fff;
            font-size: 1rem;
        }
    </style>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
</head>
<body>
    <div class="bind-img-box">
        <img class="bind-img" src="./img/bind-failed.png" alt="">
    </div>
    <p class="text">绑定失败 请重新绑定!</p>

    <div class="btn-box">
        <button onClick="back()" class="back-btn">返回至小程序页面</button>
    </div>

    <script>
        function back() {
            wx.miniProgram.navigateBack()
        }

        (function handleFrom() {
            const from = window.location.href.split('?')[1].split('=')[1]
            const btnBox = document.querySelector('.btn-box')

            if (from === 'pc') {
                btnBox.classList.add('remove')
            } else if (from === 'mpwx') {
                console.log('小程序');
            }
        })()
    </script>
</body>
</html>